package top.z.work.framework.common.exception;

/**
 * 全局错误码枚举
 */
public interface GlobalErrorCode {

    ErrorCode SUCCESS = new ErrorCode(0, "成功");

    // 客户端错误段
    ErrorCode BAD_REQUEST        = new ErrorCode(400, "请求参数不正确");
    ErrorCode UNAUTHORIZED       = new ErrorCode(401, "账号未登录");
    ErrorCode FORBIDDEN          = new ErrorCode(403, "没有该操作权限");
    ErrorCode NOT_FOUND          = new ErrorCode(404, "请求未找到");
    ErrorCode METHOD_NOT_ALLOWED = new ErrorCode(405, "请求方法不正确");
    ErrorCode LOCKED             = new ErrorCode(423, "请求失败, 请稍后重试");
    ErrorCode TOO_MANY_REQUESTS  = new ErrorCode(429, "请求过于频繁, 请稍后重试");

    // 服务端错误段
    ErrorCode INTERNAL_SERVER_ERROR = new ErrorCode(500, "系统繁忙, 请稍后再试");

}
